package com.test1230am;

public class Test18 {
    public static void main(String[] args) {
        // (18)找出数中最大元素的下标
        int[] arr = {5, 3, 7, 2, 6};
    }
    public static int m(int[] arr){
        int index=0;
        int max =arr[0];
        for(int i=1;i<arr.length;i++){
            if(max<arr[i]){
                max = arr[i];
                index = i;
            }
        }
        return index;
    }
}
